import DEF_funct
import ABC_funct


def train_model(sample_list):
    model1 = ABC_funct.solve_ABC(sample_list)
    print("模型1训练完成")
    model2 = DEF_funct.solve_DEF(sample_list)
    print("模型2训练完成")
    return model1, model2


def use_model(sample_list, model1, model2):
    result = ABC_funct.calculate_total_profit(
        sample_list, *model1
    ) + DEF_funct.calculate_total_profit(sample_list, *model2)
    print("计算完成")
    return result
